package com.kobe.tokendemo.service;

import com.kobe.tokendemo.entity.UserInfo;
import com.kobe.tokendemo.repository.UserInfoRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 创建 JYQ  on  2018/11/2,16:16
 */
@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Resource
    private UserInfoRepository repository;
    @Override
    public UserInfo login(String username, String password) {
        UserInfo userInfo = this.repository.findByUsername(username);
        if (userInfo !=null&& userInfo.getPassword().equals(password)){
//             证明查到用户信息
            return  userInfo;
        }
        return null;
    }
}
